<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>聆听乐器生产系统</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="res/css/index/x-admin.css" media="all">
<link rel="stylesheet" href="res/layui/css/layui.css" media="all">
<link rel="stylesheet" href="res/Icon/iconfont.css">
<script src="res/js/layui/layui.js" charset="utf-8"></script> 
<script src="res/js/index/x-admin.js"></script> 
<script type="text/javascript" src="res/login/jquery/jquery.min.js"></script>

</head>
<body>
<div class="layui-layout layui-layout-admin">
  <div class="layui-header header header-demo">
    <div class="layui-main">
    <div class="admin-logo-box">
				<a class="logo" href="javascript:refresh();" title="logo">聆听乐器生产</a>
				<div class="larry-side-menu">
					<i class="fa fa-th-large" aria-hidden="true"></i>
				</div>
			</div>
            <!-- <ul class="layui-nav layui-layout-left layui-ygyd-menu" style="position:absolute; left:250px;">
		      <li class="layui-nav-item"><a href="">合作机构</a></li>
		      <li class="layui-nav-item"><a href="javascript:;">订单管理</a></li>
		      <li class="layui-nav-item"><a href="">统计报表</a></li>
		      <li class="layui-nav-item">
		        <a href="javascript:;">系统管理</a>
		        <dl class="layui-nav-child">
		          <dd><a href="">角色管理</a></dd>
		          <dd><a href="">权限设置</a></dd>
		          <dd><a href="">日志管理</a></dd>
		        </dl>
		      </li>
		    </ul> -->
    
      <ul class="layui-nav" lay-filter="">
      	<li  class="layui-nav-item" ><i class="layui-icon">&#xe612;</i>   </li>
        <li class="layui-nav-item"> <a href="javascript:;" id="username"></a>
          <dl class="layui-nav-child" id='xuanxiang'>
            <!-- 二级菜单 -->
            <!-- <dd><a href="">个人信息</a></dd> -->
            <dd><a href="/Listen/login.html">切换帐号</a></dd>
            <dd><a href="javascript:exit();">退出</a></dd>
          </dl>
        </li>
      </ul>
    </div>
  </div>
  
  <div class="layui-side layui-bg-black x-side" style="left:-210px;">
    <div class="layui-side-scroll">
    
     <ul class="layui-nav layui-nav-tree site-demo-nav" lay-filter="side" id="modulemanage">
    	
      </ul>
      
    </div>
  </div>
  
  <div class="layui-tab layui-tab-card site-demo-title x-main" lay-filter="x-tab" lay-allowclose="true" style="left: 0px;border-left: solid 2px #2299ee;">
  
    <ul class="layui-tab-title">
      <li class="layui-this" id='close'>我的桌面 </li>
    </ul>
    
    <div class="layui-tab-content site-demo site-demo-body">
      <div class="layui-tab-item layui-show">
        <iframe frameborder="0" src="./welcome.html" class="x-iframe" id="myframe"></iframe>
      </div>
    </div>
  </div>
  <div class="site-mobile-shade"> </div>
</div>
<script type="text/javascript">
$(function(){
	layui.use('element', function(){
		var element = layui.element();
		//得到用户
		$.post("/Listen/listenBackstageUser/selectUser.action",null,function(mes){
			if(mes.datas==0){
				window.location = "/Listen/login.html";
			}else{
				$("#username").html("<span style='font-size:18px'>"+mes.object.buName+"</span><span id='userId' style='display:none'>"+mes.object.buId+"</span>");
				var lism = new Array();//上级模块
				var m = new Array();//下级模块
				//查询当前用户所持有的权限模块
				$.ajax({
					url:"/Listen/listenModuleManage/selectUserManage.action",
					type:"post",
					async: true,
					dataType:'json',
					data:{"userId":mes.object.buId},
					success:function(mes){
						$.each(mes,function (index,item) {
							if(item.lisMmId == 0){
								lism.push(item);
							}else{
								m.push(item);
							}
						});
						for (var i = 0; i < lism.length; i++) {
							$('#modulemanage').append('<li class="layui-nav-item" id="d'+lism[i].mmId+'"><a style="cursor:pointer;"><i class="iconfont '+lism[i].mmIcon+'" style="top: 3px;"></i><cite>'+lism[i].mmName+'</cite></a></li>');
							for (var j = 0; j < m.length; j++) {
								if(m[j].lisMmId== lism[i].mmId){
									$("#d"+lism[i].mmId).append('<dl class="layui-nav-child"><dd><a href="javascript:;" _href='+m[j].mmUrl+' nav-id="'+m[j].mmId+' title='+m[j].mmName+'">' + '<cite>'+m[j].mmName+'</cite></a></dd></dl>');
								}
							}
						}
						element.init();
					},
					error:function(data){
						alert("系统出错");
					}
				})
			}
		},'json')
	})
})
	function close(){
	 $($(".layui-unselect").parent()).remove();
	 $("#exitBq").remove();
	 
	}
	//退出用户
	function exit(){
		$.post("/Listen/listenBackstageUser/removeUser.action",null,function(mes){
			if(mes.datas==1){
				window.location = "/Listen/login.html";
			}
		},'json')
	}
	
	//刷新页面
	function refresh(){
		window.location.reload();
	}
</script>
</body>
</html>